#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<stdlib.h>

int cmp(const void* a, const void* b)
{
	return *(int*)a - *(int*)b;
}

int* find_single_dog(int* arr, size_t len)
{
	qsort(arr,len,sizeof(int),cmp);
	int pre = arr[0];
	int* ret = (int*)malloc(2 * sizeof(int));
	if (NULL == ret)
	{
		perror("malloc");
	}
	int j = 0;
	int time = 1;
	for (int i = 1; i < len; ++i)
	{
		if (arr[i] != pre)
		{
			if(time == 1)
			{
				ret[j++] = pre;
				pre = arr[i];
			}
			else
			{
				time = 1;
				pre = arr[i];
			}
		}
		else if (arr[i] == pre)
			++time;
		if (j == 2)
			break;
	}
	return ret;
}

int main()
{
	int arr[10] = {1,1,3,3,8,8,4,6,2,2};
	int* ret = find_single_dog(arr, 10);
	printf("%d %d\n", ret[0], ret[1]);
	free(ret);
	ret = NULL;
	return 0;
}